package br.com.naybee.client.views.add.repartimento;

import br.com.naybee.client.views.components.BotaoLigarDesligarLampada;
import br.com.naybee.framework.client.componente.gwt.web.Div;
import br.com.naybee.framework.client.models.Model;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class RepartimentoFuncaoItemView extends Composite {

	private static RepartimentoFuncaoItemViewUiBinder uiBinder = GWT.create(RepartimentoFuncaoItemViewUiBinder.class);

	interface RepartimentoFuncaoItemViewUiBinder extends UiBinder<Widget, RepartimentoFuncaoItemView> {
	}

	private Model param;
	@UiField
	protected Div descricao;
	@UiField
	protected Div button;

	public RepartimentoFuncaoItemView() {
		initWidget(uiBinder.createAndBindUi(this));
	}

	public RepartimentoFuncaoItemView(Model param) {
		initWidget(uiBinder.createAndBindUi(this));
		this.param = param;
		init();
	}

	private void init() {
		descricao.setText(param.getStr("descricaoConfiguracao"));
		BotaoLigarDesligarLampada botaoLigarDesligarLampada = new BotaoLigarDesligarLampada(param);
		button.add(botaoLigarDesligarLampada);
	}

}
